package com.springboot.crawler.controller;

import com.springboot.crawler.service.RegionCrawlServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by dongfangchao on 2017/6/1/0001.
 */
@RestController
@RequestMapping(value = "crawl/region")
public class RegionCrawlController {

    @Autowired
    private RegionCrawlServiceImpl regionCrawlServiceImpl;

    @GetMapping(value = "crawlRegion")
    public String crawlRegion(){
        try {
            regionCrawlServiceImpl.provinceCrawl();
            return "ok";
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "fail";
    }

}
